<?php
require_once('../../config.php');
Doctrine::loadModels('../../models');

if( $_REQUEST["calender_id"])
{
	$calender_id = strip_tags($_REQUEST["calender_id"]);
    $milestone_date = strip_tags($_REQUEST["milestone_date"]);
	$alert_action_id = strip_tags($_REQUEST["alert_action_id"]);
	$alert_period = strip_tags($_REQUEST["alert_period"]);
	$cal_item = strip_tags($_REQUEST["cal_item"]);
	$modified = date("Y-m-d H:m:s");
	 
	$db_query = sprintf("UPDATE agent_calender
							SET alert_action_id='".$alert_action_id."',	
								milestone_date='".$milestone_date."',
								alert_period='".$alert_period."', 
								cal_item='".$cal_item."',
								modified='".$modified."'
							WHERE calender_id='".$calender_id."'");
 
 	file_put_contents  ( "update_calender.txt", $db_query);   
 
 	$result = mysql_query($db_query);
    	if (!$result) {
        		die('invalid query');    // . mysql_error());
    		}
}

//mysql_free_result( $result )
	
?>